﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Polar.AI.Common
{
    public static class FloatExtensions
    {
        /// <summary>
        /// Assuming this float represents a radian, return the vector.
        /// </summary>
        public static Vector2 ToVector2(this float radians)
        {
            return new Vector2((float)Math.Cos(radians), (float)Math.Sin(radians));
        }

        /// <summary>
        /// Compares a this float to value with a persition of +- 0.1
        /// </summary>
        public static bool EqualTo(this float source, float value)
        {
            return Calc.FloatEqualTo(source, value);
        }
    }
}
